package com.meowcook.pojo.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 28792
 * Date: 2025-05-10
 * Time: 13:49
 */
@ApiModel(value = "食材参数")
@Data
public class MaterialAddDTO {
    @Length(max = 30, message = "名字不能超过30字")
    @NotBlank
    @ApiModelProperty(value = "食材名称，不能超过30字", required = true)
    private String name;

    @Max(value = 60000, message = "数量过大，请选择合适的单位")
    @Min(value = 1, message = "数量不能小于1")
    @NotNull
    @ApiModelProperty(value = "食材数量，不能小于1，不能大于60000", required = true)
    private Short quantity;

    @NotNull
    @ApiModelProperty(value = "枚举类，食材单位，1-克，2-千克，3-毫升，4-升", required = true)
    private Byte unit;

    @NotNull
    @ApiModelProperty(value = "枚举类，食材类别，1-主料，2-辅料，3-调料", required = true)
    private Byte category;
}
